package com.cn.study007;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName Test70014.java
 * @Description
 * @createTime 2023年05月14日 16:33:00
 */
public class Test70014 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = "";
        int count = 0;
        for (int i = 1; i <= 5; i++) {
            System.out.println("欢迎光临第"+i+"家专卖店");
            for (int j = 1; j <= 10; j++) {
                System.out.print("要离开吗？(y/n) ");
                str = sc.next();
                if (str.equals("n")){
                    System.out.println("买了一件衣服");
                    count++;
                }else if (str.equals("y")){
                    System.out.println("离店结账\n");
                    break;
                }
            }

        }
        System.out.println("总共买了"+count+"件衣服");
    }

}
